<?php

$absolute_path = __FILE__;
$path_to_file = explode( 'wp-content', $absolute_path );
$path_to_wp = $path_to_file[0];
require_once( $path_to_wp.'/wp-load.php' );

if(isset($_GET['order']))
{
	$order_array = explode(',', $_GET['order']);

	array_pop($order_array);

	global $wpdb;
	
	foreach($order_array as $key => $order)
	{
		$query = "UPDATE ".$wpdb->prefix."lazar_slider SET `position` = '$key' WHERE `id` = '$order'";	
		$wpdb->get_results($query);	
		echo $query.'<br />';
	}
	print_r($order_array);
	
}
?>